#include <stdio.h>
#include <stdlib.h>
#include "aimage.h"
#include "aimage_utils.h"
#include "aimage_dcraw.h"
#include "aimage_ppm.h"

int main( int argc, char *argv[] )
{
        AIMAGE image;

        if ( argc != 1 && argc != 2 )
        {
                fprintf(stderr, "%s [in_file]\n", argv[0] );
                exit( 1 );
        }

        if ( argc == 2 )
        {
		AIMAGE_PPM_UTILS::load( image, argv[ 1 ] );
        }
        else
	{
		AIMAGE_PPM_UTILS::load( image, "stdin" );
	}
	AIMAGE_PPM_UTILS::save( image, "stdout", false );
}

